package com.authine.cloudpivot.ext.util;

import com.authine.mvp.app.launcher.dto.errorcode.ErrorCodeEnum;
import com.authine.mvp.app.launcher.utils.ModelRuntimeException;

import java.util.LinkedHashMap;

public class ExcelFixedCoding {


    private static LinkedHashMap<String,String> t_goods = new LinkedHashMap<>();

    static {
        //主模型字段
        t_goods.put("brand","品牌");
        t_goods.put("name","商品名称");
        t_goods.put("model","型号");
        t_goods.put("spec","规格");
        t_goods.put("catalog","平台目录");
        t_goods.put("unit","报价单位");
        t_goods.put("package_num","包装内数量");
        t_goods.put("package_unit","包装单位");
        t_goods.put("min_order","最小起订量");
        t_goods.put("tax_rate","税率");
        t_goods.put("pretax_price","未税单价");
        t_goods.put("delivery_place","发货地");
        t_goods.put("expiry","销售有效期至(日期)");
        t_goods.put("stock","库存数量");
        t_goods.put("delivery","无库存交货期(天)");
        t_goods.put("enabled","启禁用");
        t_goods.put("sku","SKU");
        t_goods.put("bar_code","条形码");
        t_goods.put("golden_tax","金税编码");
        t_goods.put("unspsc","UNSPSC");
        t_goods.put("description","商品描述");
        t_goods.put("technical","技术参数");
        t_goods.put("packaging","包装参数");
        t_goods.put("place","产地");
        t_goods.put("length","长(mm)");
        t_goods.put("width","宽(mm)");
        t_goods.put("height","高(mm)");
        t_goods.put("weight","重量(g)");
        t_goods.put("memo","商品备注");
        t_goods.put("safe_stock","安全库存");
        t_goods.put("warranty","保修期");
        t_goods.put("images","商品图片");
        t_goods.put("stockDelivery","现货交货期(天)");
        t_goods.put("delivery_claim","货期要求");
        t_goods.put("godds_detail_images","上传商品详情图");

    }

    public static LinkedHashMap<String,String> getExcelColumnMap(String sonSchemaCode){
        switch (sonSchemaCode){
            case "t_goodses":
                return t_goods;
            default:
                throw new ModelRuntimeException(ErrorCodeEnum.BIZ_PARAMS_ERR, "不存在对应导入模型对应列表转换处理");
        }
    }

}
